class Employee:
    _ID = 0
    name = ""
    age = 0
    #构造器
    def __init__ (self,name,age):
        self.name = name
        self.age = age        
        self.id = self._ID
        self.__class__._ID += 1 
    def sayHello(self):
        print("hello {}".format(self.name)) 
#实例1
em = Employee("Mr.Yang",20)
print(em.name)
print(em._ID)
 
#实例2
em2 = Employee("Ms.Peng",20)
print(em2.name)
print(Employee._ID)
em2.sayHello()
 
 
print("一共实例化了{}个实例".format(Employee._ID))
